Mechanically move protos and structs for units.cc from defs.h to units.h
authorRobert Lipe <robertlipe@gpsbabel.org>
Mon, 9 Dec 2019 15:41:57 +0000 (09:41 -0600)
committerRobert Lipe <robertlipe@gpsbabel.org>
Mon, 9 Dec 2019 15:41:57 +0000 (09:41 -0600)
GPSBabel.pro
defs.h
kml.cc
units.cc
units.h [new file with mode: 0644]

index bdb7b2f627a71c6a3febd94e3c2572f9c05cc2e9..206e5c90be8e218b08e66cd320d3688a3cb83890 100644 (file)
@@ -137,6 +137,7 @@ HEADERS =  \
        session.h \
        shapelib/shapefil.h \
        strptime.h \
+       units.h \
        xcsv.h \
        xmlgeneric.h \
        zlib/crc32.h \
diff --git a/defs.h b/defs.h
index c6e28db049146756be222dbec6d75251e094c34b..b80b26c7b6a711323825155a14c61898a5d95e1d 100644 (file)
--- a/defs.h
+++ b/defs.h
@@ -1252,22 +1252,6 @@ int parse_speed(const QString& str, double* val, double scale, const char* modul
  */
 unsigned long get_crc32(const void* data, int datalen);
 
-/*
- *  From units.c
- */
-enum fmt_units {
-  units_unknown = 0,
-  units_statute = 1,
-  units_metric = 2,
-  units_nautical =3,
-  units_aviation =4
-};
-
-int    fmt_setunits(fmt_units);
-double fmt_distance(double, const char** tag);
-double fmt_altitude(double, const char** tag);
-double fmt_speed(double, const char** tag);
-
 /*
  * From nmea.c
  */
diff --git a/kml.cc b/kml.cc
index f9d06f6644472d0922997b2b1f006ce89ae78d2f..e53e117cf30eab34f5e2c5e05ea3fb371c0dec07 100644 (file)
--- a/kml.cc
+++ b/kml.cc
@@ -53,6 +53,7 @@
 #include "src/core/xmlstreamwriter.h"   // for XmlStreamWriter
 #include "src/core/xmltag.h"            // for xml_findfirst, xml_tag, fs_xml, xml_attribute, xml_findnext
 #include "xmlgeneric.h"                 // for cb_cdata, cb_end, cb_start, xg_callback, xg_string, xg_cb_type, xml_deinit, xml_ignore_tags, xml_init, xml_read, xg_tag_mapping
+#include "units.h"
 
 // options
 static char* opt_deficon = nullptr;
index bd2540484a82c3a79125b18e74ab0c8cae22d603..746f555745ef578da39637b255e73253ed181f86 100644 (file)
--- a/units.cc
+++ b/units.cc
@@ -20,6 +20,7 @@
  */
 
 #include "defs.h"
+#include "units.h"
 
 static int units = units_statute;
 
@@ -132,4 +133,4 @@ fmt_speed(const double distance_meters_sec, const char** tag)
 
   }
   return d;
-}
+}
\ No newline at end of file
diff --git a/units.h b/units.h
new file mode 100644 (file)
index 0000000..fec3ff6
--- /dev/null
+++ b/units.h
@@ -0,0 +1,47 @@
+/*
+    Display scaled distances in 'local' units.
+
+    Copyright (C) 2006 Robert Lipe, robertlipe+source@gpsbabel.org
+
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+
+ */
+
+
+#ifndef GPSBABEL_UNITS_H
+#define GPSBABEL_UNITS_H
+
+/*
+ *  From units.c
+ */
+enum fmt_units {
+  units_unknown = 0,
+  units_statute = 1,
+  units_metric = 2,
+  units_nautical =3,
+  units_aviation =4
+};
+
+int    fmt_setunits(fmt_units);
+
+double fmt_distance(double, const char** tag);
+
+double fmt_altitude(double, const char** tag);
+
+double fmt_speed(double, const char** tag);
+
+#include "defs.h"
+
+#endif //GPSBABEL_UNITS_H